<!-- 统计分析 -> 数据目录 -->
<script>
import { defineComponent } from 'vue';
import GlobalCard from '@/components/GlobalCard/global-card.vue';
export default defineComponent({
  name: "SectionFour",
  components: {
    GlobalCard,
  },
  setup() {
  },
  data() {
    return {
      data_1: 35130,
      data_2: 400,
      data_3: 98
    }
  },
  mounted() {
    setTimeout(() => {
      this.init();
    }, 30)
  },
  watch: {
  },
  computed: {
  },
  beforeRouteLeave() { },
  methods: {
    init() {

    }
  }
});
</script>
<template>
  <div class="section-four">
    <GlobalCard :mainTitle="'供热指标总览'">
      <template #body>
        <!-- 代码 -->
        <div id="Gongrezhibiaozonglan">

          <div class="item green">
            <div class="icon green">
              <div class="numb">
                <span class="data green font-YouSheBiaoTiHei">
                  <count-to :startVal="0" :endVal="data_3" :duration="3000" :autoplay="true" />
                </span>
                <span class="unit "> %</span>
              </div>
            </div>
            <div class="name font-alimamashuheiti">供热覆盖率</div>
          </div>

          <div class="item gold">
            <div class="icon gold">
              <div class="numb">
                <span class="data green font-YouSheBiaoTiHei">
                  <count-to :startVal="0" :endVal="data_1" :duration="3000" :autoplay="true" />
                </span> <span class="unit font-PINGFANG_MEDIUM"> 户</span>
              </div>
            </div>

            <div class="name font-alimamashuheiti">供热小区户数</div>
          </div>


        </div>
      </template>
    </GlobalCard>
  </div>
</template>
<style scoped lang="less">
.section-four {
  position: fixed;
  top: 11rem;
  right: 44rem;
  height: 18rem;
}

#Gongrezhibiaozonglan {
  height: 12rem;
  display: flex;
  justify-content: space-around;
  align-items: center;

  &>.item {
    font-size: 1rem;
    text-align: center;
    width: 50%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    &>.icon {
      width: 10rem;
      height: 5.5rem;
      background-repeat: no-repeat;
      background-size: 100% 100%;
      position: relative;
      background-image: url(./images/tuopan.png);


      &>.numb {
        margin-bottom: 10px;
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;

        &>span.data {
          font-size: 2.5rem;
          font-weight: bolder;
          // background-image: linear-gradient(to bottom, #cdf9ff 0, #cdf9ff 20%, #ffffff 50%, #87efff 70%, #87efff 100%);
          -webkit-background-clip: text;
          -webkit-text-fill-color: transparent;

          &.green {
            background-image: linear-gradient(to bottom, #cdf9ff 0, #cdf9ff 20%, #ffffff 50%, #40f148 70%, #40f148 100%);
          }

          &.gold {
            background-image: linear-gradient(to bottom, #cdf9ff 0, #cdf9ff 20%, #ffffff 50%, #ffc200 70%, #ffc200 100%);
          }

          &.red {
            background-image: linear-gradient(to bottom, #cdf9ff 0, #cdf9ff 20%, #ffffff 50%, #f93030 70%, #f93030 100%);
          }

          &.aqua {
            background-image: linear-gradient(to bottom, #cdf9ff 0, #cdf9ff 20%, #ffffff 50%, #00ffff 70%, #00ffff 100%);
          }
        }

        &>span.unit {
          margin-top: 3px;
          margin-left: 5px;
          font-size: 1.5rem;
        }
      }
    }



    &>.name {
      font-size: 20px;
      margin-top: 20px;
    }
  }

  .red .numb {
    left: 0;
  }
}
</style>